<%@page import="com.guagua.chat.post.PostInfo"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTf-8"%>
<%
	int roomMaster = (Integer) request.getAttribute("roomMaster");
	long userId =(Long) request.getAttribute("userId");
    Map resultData = (Map)request.getAttribute("resultData");
	int count = (Integer)((Map)request.getAttribute("resultData")).get("count");
	int pageCount = (int)Math.ceil(((double)count/10.0d));
	int pageNo  = (Integer)((Map)request.getAttribute("resultData")).get("pageNo");
	List<PostInfo> postInfos = (List<PostInfo>)resultData.get("listdata");
	int listSize = postInfos!=null?postInfos.size():0;
	long postId = (Long)resultData.get("postId");
	PostInfo postInfo = (PostInfo) resultData.get("post");
%>

                    		<h3><p class="left"><%=postInfo.getTitle() %></p><a class="right" href="javascript:void(0)" onclick="showPostList(1)"><i></i>返回话题列表</a></h3>
                            <ul class="lTab2">
                            <%for(int i = 0 ; i < listSize ; i++) {
                            	PostInfo _pInfo = postInfos.get(i);
                            %>
	                                <li>
	                                
	                                    
	                                
	                                
	                                
	                                    <a class="leftAvatar" target="_blank" href="http://zone.17guagua.com/<%=_pInfo.getUser_id()%>"><img src="http://zone1.ggimg.cn/custom/portrait/<%=_pInfo.getUser_id() %>_small.jpg" name="infocard<%=_pInfo.getUser_id()%>" ></a>
	                                    <div class="rightItem">
	                                    
	                                    <p class="rI_info1"><a target="_blank" href="http://zone.17guagua.com/<%=_pInfo.getUser_id()%>" ><%=_pInfo.getUser_nick() %></a><span><%=(pageNo-1)*10+i+1 %>楼</span></p>
                                        <span class="rI_info" id="postInfo_<%=_pInfo.getId() %>"><%=_pInfo.getContent() %></span>
                                        <p class="rI_detail"><span><%=_pInfo.getRevertTime() %></span><span></span>
                                        <a href="javascript:void(0)" onClick="revertPostText('<%=_pInfo.getId() %>','<%=(pageNo-1)*10+i+1 %>','<%=_pInfo.getUser_nick()%>','<%=_pInfo.getUser_id() %>');return false;">回复</a>
                                       			<%if(roomMaster == 1){ %>
		                                        	 <%if(_pInfo.getParent_id()==0L){ %>
		                                        	  <a href="javascript:void(0)" onclick="delPost(<%=_pInfo.getId()%>);return false;">删除</a>
		                                        	 <%}else{ %>
		                                        	  <a href="javascript:void(0)" onclick="deleteRevertPost(<%=_pInfo.getId()%>,<%=_pInfo.getParent_id()%>);return false;">删除</a>
		                                        	 <%} %>
		                                      <%}else if(userId ==_pInfo.getUser_id() ){ %>
		                                        	 <a href="javascript:void(0)" onclick="deleteRevertPost(<%=_pInfo.getId()%>,<%=_pInfo.getParent_id()%>);return false;">删除</a>
		                                      <%} %>
                                        
                                        </p>
                                        
	                                       
	                                       
	                                       
	                                       
	                                        
	                                        </p>
	                                    </div>
	                                </li>
                                <%} %>
                            </ul>
                            <ul class="nbList">
                                 <%if(pageNo>1 && pageCount>1){%>
                                  <a href="javascript:void(0)" onclick="showPostInfo(<%=postInfo.getId()%>,'1');return false;" >首页</a>
                                  <a href="javascript:void(0)" onclick="showPostInfo(<%=postInfo.getId()%>,'<%=pageNo-1 %>');return false;" >上一页</a>
                                  <%} %>
                                  <%
                                 	 int start = pageNo-4;
                              		if(((start+9) - pageCount)>0){
                              		start = start-((start+9) - pageCount);
                              		
                              		}
                              		if(start<1) start =1;
                                  %>
	
                                <%for(int i = start,j=1 ; i <= pageCount&& j<=10 && pageCount>1;j++,i++){ %>
                                	<a href="javascript:void(0)" onclick="showPostInfo(<%=postInfo.getId()%>,'<%=i %>');return false;" <%if(i == pageNo){ %>class="on" <%} %>><%=i %></a>
                                <%} %>
                                <%if(pageNo != pageCount && pageCount>1){ %>
		                       <a href="javascript:void(0)" onclick="showPostInfo(<%=postInfo.getId()%>,'<%=pageNo+1 %>');return false;" >下一页</a>
		                       <a href="javascript:void(0)" onclick="showPostInfo(<%=postInfo.getId()%>,'<%=pageCount %>');return false;" >末页</a>
								<%}%> 
                            </ul>
                            <div class="inputBox2">
                                <div class="tr2" id="revertDiv" style="display:none">回复 <a href="javascript:void(0)" id="revertUserNick">云淡风轻123</a>（<span id="revertFloor"></span>楼）：<span id="revertContent"></span><a class="close" href="javascript:void(0)" id="revertClose" onClick="revertClose()"></a></div>
                                <div class="tr1"><textarea class="textarea2" id="revertPostText" onchange="postWordChange(this)" onkeyup="postWordChange(this)" onmouseup="postWordChange(this)"></textarea></div>
                                <div class="tr1"><a href="javascript:void(0)" class="phizOne" id="revert_post_message_face"><i class="iconA"></i>表情</a><a class="but" href="javascript:void(0)" onclick="revertPost('<%=postId%>')"></a><div class="wPrompt">您还可以输入<span class="surplusPostNum">300</span>字</div></div>
                            </div>
                        

